feat(core/inlines): add !!type disambiguation for IDL links#5240
feat(core/inlines): add !!type disambiguation for IDL links#5240marcoscaceres wants to merge 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates ReSpec’s inline link micro-syntax ([= ... =]) so it can resolve local definitions that are typed as events (data-dfn-type="event"), addressing #4290 where event-type definitions weren’t being linked.
Changes:
- Extend
[= ... =]generated anchors to includeeventindata-link-typesocore/link-to-dfncan match event dfns.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
Yes, all feedback has been addressed:
|
sidvishnoi
left a comment
There was a problem hiding this comment.
I think the {{ }} syntax is better suited for events. Any reason for not going with that?
Adds Bikeshed-compatible !!type suffix to {{ }} IDL inline syntax.
When present, the type hint overrides the default fallback type list,
allowing authors to disambiguate between IDL members that share a name
(e.g., an attribute and an event on the same interface).
Example: {{ PermissionStatus/change!!event }} links specifically to the
"change" event, not the "onchange" attribute.
Reverts the [= =] approach for event linking in favor of this general
type disambiguation mechanism.
Closes #4290
|
Reworked to use Bikeshed-compatible This is a general mechanism (not event-specific) that works like Bikeshed's The |
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
… fix JSDoc
- Add `showWarning` to imports
- Define `validTypeHints` set for the `!!type` disambiguation suffix
- Fix `parseInlineIDL` JSDoc: `@returns {InlineIdl[]}` → `@returns {{ tokens: InlineIdl[], typeHint: string }}`
- Validate `typeHint` in `idlStringToHtml`: warn and fall back to default when type is unknown
- Add test for invalid `!!type` hint warning behavior
Agent-Logs-Url: https://github.com/speced/respec/sessions/e4d82a3b-b17c-4efd-bbdf-5170f1489756
Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
Use concise common-type hint instead of listing all 20 valid types. Agent-Logs-Url: https://github.com/speced/respec/sessions/e4d82a3b-b17c-4efd-bbdf-5170f1489756 Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
All prior reviewer feedback was addressed. Additionally, I found and fixed two issues in the reworked implementation:
|
Closes #4290
Adds Bikeshed-compatible
!!typesyntax for disambiguating IDL links in{{ }}shorthand. This lets authors force a specific IDL type when the default resolution picks the wrong definition (e.g., an attribute namedchangevs thechangeevent).Syntax:
{{ Interface/member!!type }}Example:
{{ ScreenOrientation/change!!event }}forces resolution as an event, not an attribute.Also fixes
[= term =]links to properly resolvedata-dfn-type="event"definitions (the original bug).Invalid type hints produce a warning and fall back to default resolution behavior.